package com.bbu.javaexam.dao;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.bbu.javaexam.domain.vo.AnswerVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @author Alex
 * @version 1.0.0
 * @ClassName AnswerMapper.java
 * @Description TODO
 */
@Mapper
public interface AnswerMapper {
    /**
     * @throws
     * @title 通过分页查找所有问题答案，并总结为一个数据实体
     * @description
     * @author Alex
     * @updateTime 2021/12/5 14:36
     */
    @Select("select questionId,question, subject, score, section,level, \"选择题\" as type from multi_question " +
            "union select  questionId,question, subject, score, section,level, \"判断题\" as type  from judge_question " +
            "union select  questionId,question, subject, score, section,level, \"填空题\" as type from fill_question")
    IPage<AnswerVO> findAll(Page page);
}
